//
//  UIBUtton+extension.swift
//  MyKC
//
//  Created by yy on 2017/3/10.
//  Copyright © 2017年 com.yasuo. All rights reserved.
//

import UIKit
extension UIButton {
    
    class func creatBtn(fontSize: CGFloat,title: String, imageName: String = "") -> UIButton {
        let btn = UIButton()
        btn.setTitle(title, for: .normal)
        btn.titleLabel?.font = UIFont.systemFont(ofSize: fontSize)
        btn.sizeToFit()
        return btn
    }
    
    
    convenience init(fontSize: CGFloat,title: String, imageName: String = "") {
        self.init()
        setImage(UIImage(named: imageName), for: .normal)
        setTitle(title, for: .normal)
        titleLabel?.font = UIFont.systemFont(ofSize: fontSize)
        sizeToFit()
    }
}
